home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.plaf.metal;
-
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Graphics;
-
- class MetalIconFactory$InternalFrameCloseIcon extends MetalIconFactory.InternalFrameMaximizeIcon {
- Color slashColor;
-
- public MetalIconFactory$InternalFrameCloseIcon(int size) {
- super(size);
- }
-
- public void paintIcon(Component c, Graphics g, int x, int y) {
- super.paintIcon(c, g, x, y);
- this.slashColor = MetalLookAndFeel.getPrimaryControlDarkShadow();
- if (super.parentButton.getClientProperty("paintActive") != Boolean.TRUE) {
- this.slashColor = MetalLookAndFeel.getControlDarkShadow();
- } else if (super.buttonModel.isPressed() && super.buttonModel.isArmed()) {
- this.slashColor = MetalLookAndFeel.getPrimaryControlInfo();
- }
-
- g.translate(x, y);
- g.setColor(this.slashColor);
-
- for(int i = 2; super.iconSize >= i + 4; ++i) {
- g.fillRect(i, super.iconSize - i - 2, 2, 2);
- }
-
- g.translate(-x, -y);
- }
-
- public int getIconWidth() {
- return super.iconSize;
- }
-
- public int getIconHeight() {
- return super.iconSize;
- }
- }
-